"""
API Package
API包 - 包含所有API路由和中间件
"""

from .auth import router as auth_router
from .content import router as content_router
from .folders import router as folders_router
from .tags import router as tags_router
from .admin import router as admin_router
from .system import router as system_router
from .dependencies import (
    get_current_user_from_token,
    get_current_active_user,
    get_current_admin_user,
    get_user_or_404,
    get_content_or_404,
    get_folder_or_404,
    get_tag_or_404,
    validate_content_type,
    validate_ai_provider,
    validate_pagination_params,
    validate_sort_params,
    validate_date_range,
    get_pagination_deps,
    get_sort_deps,
    get_date_range_deps,
    PermissionChecker,
    require_system_permission,
    oauth2_scheme
)
from .middleware import (
    RequestLoggingMiddleware,
    ErrorHandlingMiddleware,
    AuthenticationMiddleware,
    RateLimitMiddleware,
    SecurityHeadersMiddleware,
    create_middleware_stack,
    get_client_ip
)

# 导出所有API路由和依赖
__all__ = [
    # 路由
    "auth_router",
    "content_router", 
    "folders_router",
    "tags_router",
    "admin_router",
    "system_router",
    
    # 依赖注入
    "get_current_user_from_token",
    "get_current_active_user",
    "get_current_admin_user",
    "get_user_or_404",
    "get_content_or_404",
    "get_folder_or_404",
    "get_tag_or_404",
    "validate_content_type",
    "validate_ai_provider",
    "validate_pagination_params",
    "validate_sort_params",
    "validate_date_range",
    "get_pagination_deps",
    "get_sort_deps",
    "get_date_range_deps",
    "PermissionChecker",
    "require_system_permission",
    "oauth2_scheme",
    
    # 中间件
    "RequestLoggingMiddleware",
    "ErrorHandlingMiddleware",
    "AuthenticationMiddleware",
    "RateLimitMiddleware",
    "SecurityHeadersMiddleware",
    "create_middleware_stack",
    "get_client_ip"
]
